home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 11,000 to 11,999 / 11000.zip / AOLDLs / Web-Publishing / Java fuer Windows 95 / JAVA.lzh / JAVA / JAVA.ZIP / HREFButtonApplet.java < prev    next >
Encoding:
Java Source  |  1996-06-23  |  1.3 KB  |  46 lines

  1. import java.applet.*;
  2. import java.awt.*;
  3.  
  4. /**
  5.  * An applet that demonstrates HREFButton.
  6.  * Requires HREFButton.class
  7.  *
  8.  * @author L. Todd Lowe, ltlowe@achilles.net
  9.  * Last change:  LTL  22 Jun 96   10:21 pm
  10.  */
  11. public class HREFButtonApplet extends Applet
  12. {
  13.     HREFButton b;
  14.     
  15.     /**
  16.      * Initialise the applet.  Get the parameters and pass
  17.      * them to HREFButton().
  18.      *
  19.      * @param href   The URL to be loaded when the button is pressed. (From <Applet> tag.)
  20.      * @param frame  The frame in which to display the URL (optional). (From <Applet> tag.)
  21.      * @param label  The label of the button. (From <Applet> tag.)
  22.      */
  23.     public void init() 
  24.     {
  25.         setLayout( new GridLayout(1,1) ); 
  26.         b = new HREFButton( this, 
  27.                             getParameter("href"),
  28.                             getParameter("frame"),
  29.                             getParameter("label")  );
  30.         add(b);
  31.     }
  32.  
  33.     /**
  34.      * mouseEnter() is needed at the Applet level to
  35.      * prevent Netscape from displaying "Applet is running"
  36.      * every time the mouse moves over the applet.
  37.      * Without this patch/kludge the status updates of the
  38.      * HREFButton are often overwritten and obscured! 
  39.      */
  40.     public boolean mouseEnter(Event e, int x, int y )
  41.     {
  42.         return true;
  43.     }
  44. }
  45.  
  46.